Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Autoload CryptoProvider classes #406

Merged
merged 1 commit into from
Apr 28, 2014

Conversation

tiegz
Copy link
Collaborator

@tiegz tiegz commented Apr 10, 2014

In a recent commit (c2eae1c) I removed some old require code for bcrypt/scrypt.

This ends up throwing the LoadError in your app if you don't have those two gems in your Gemfile, but we still don't necessarily need the gems to run Authlogic.

This change autoloads each CryptoProvider when necessary rather than requiring all of them when loading Authlogic.

(fixes a bug where scrypt/bcrypt gems are required to run Authlogic --
let's just require them when necessary)
rw_config(:crypto_provider, CryptoProviders::SCrypt)
else
rw_config(:crypto_provider, value)
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only semi-weird part. Loading SCrypt here would require the gem (even w/autoload). So I only set it as the default if the provider hasn't been set yet.

It works, but another alternative could be allowing procs as the rw_config value?

@tiegz tiegz changed the title Autoload CryptoProvider classes Fix: Autoload CryptoProvider classes Apr 11, 2014
@tiegz tiegz mentioned this pull request Apr 11, 2014
@josh-m-sharpe
Copy link
Contributor

+1 for this

@gregawoods
Copy link

+1, also addresses my issue #405.

@d-natoli
Copy link

+1

1 similar comment
@AxisOfEval
Copy link

+1

binarylogic added a commit that referenced this pull request Apr 28, 2014
Fix: Autoload CryptoProvider classes
@binarylogic binarylogic merged commit 55b84f3 into binarylogic:master Apr 28, 2014
@tiegz
Copy link
Collaborator Author

tiegz commented Apr 28, 2014

thx!

@yourewelcome you weren't out at RailsConf, were you?

@binarylogic
Copy link
Owner

No, I wanted to go, couldn't make it this year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants